<%@page import="cn.com.scau.tstjxt.util.DBUtil"%>
<%@page import="cn.com.scau.tstjxt.util.SpringUtil"%>
<%@page import="java.io.PrintWriter"%>    
<%@page import="java.io.OutputStream"%>    
<%@page import="java.io.InputStream"%>    
<%@page import="java.sql.ResultSet"%>    
<%@page import="java.sql.PreparedStatement"%>    
<%@page import="java.sql.Connection"%>    
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>    
<%    
    response.reset();    
    String systemid = request.getParameter("systemid");    
    Connection conn = null;    
    PreparedStatement ps = null;    
    ResultSet rs = null;    
    InputStream is = null;    
    OutputStream os = null;    
    try{    
        conn = DBUtil.getJzhmConnection();    
        ps = conn.prepareStatement("select t.cover from t_book t where t.systemid =?");    
        ps.setString(1, systemid);    
        rs = ps.executeQuery();    
        if(rs.next()){    
            is = rs.getBinaryStream(1);    
        }    
        response.setContentType("image/jpeg");    
        os = response.getOutputStream();    
        int num;    
        byte buf[] = new byte[1024];    
        while(   (num=is.read(buf))!=-1   ){    
            os.write(buf, 0, num);    
        }    
        os.flush();     
    }catch(Exception e){    
        e.printStackTrace();    
    }finally{      	   
        is.close();    
        os.close();
    }    
%>   